package cn.kpi.service.sys.impl;

import cn.kpi.dao.sys.ConfigureDao;
import cn.kpi.entity.sys.Configure;
import cn.kpi.service.sys.IConfigureService;
import io.swagger.annotations.Authorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: kpispis
 * @BelongsPackage: cn.kpi.service.sys.impl
 * @Author: lizeze
 * @CreateTime: 2018-07-19 14:46
 * @Description: ${Description}
 */
@Service
public class ConfigureServiceImpl implements IConfigureService {

    @Autowired
    private ConfigureDao configureDao;

    @Override
    public List<Configure> getAll(String where) {
        return configureDao.getAll(where);
    }

    @Override
    public int addConfigure(Configure configure) {
        return configureDao.addConfigure(configure);
    }

    @Override
    public int updateConfigure(List<Configure> configureList) {
        try {
            for (int i = 0; i < configureList.size(); i++) {

                configureDao.updateConfigure(configureList.get(i));
            }
        } catch (Exception ex) {
            return 0;
        }
        return 1;
    }

}
